import * as fs from 'fs';

/**
 * 简单的日志记录接口
 */
export interface Logger {
  info(message: string): void;
  error(message: string): void;
}

/**
 * 日志记录实现
 */
export const logger: Logger = {
  info(message: string): void {
    console.log(`[INFO] ${new Date().toISOString()} - ${message}`);
    fs.appendFileSync('feishu_bot.log', `[INFO] ${new Date().toISOString()} - ${message}\n`);
  },
  error(message: string): void {
    console.error(`[ERROR] ${new Date().toISOString()} - ${message}`);
    fs.appendFileSync('feishu_bot.log', `[ERROR] ${new Date().toISOString()} - ${message}\n`);
  }
}; 